/**
 * Created by 田西泽 on 2015-8-26.
 */
public class Laboratory {
    public static void main(String[] args) {

        int i = 735;
        while ((i--) % 3 != 0) {
            System.out.println(i);
        }
    }
}
